
#include "scene_base.h"

Scene::Scene()
{
    rootView = new View();
}

Scene::~Scene()
{
    delete rootView;
}

void Scene::OnBegin()
{
    rootView->OnBegin();
}

void Scene::OnExit()
{
    rootView->OnExit();
}

void Scene::OnPause()
{
    ;
}

void Scene::OnGoing()
{
    ;
}

int32_t Scene::OnDraw(Image *image, Rect rangeLimit)
{
    //先画自己
    rootView->OnDraw(image, rangeLimit);

    //限制范围更新
    ;

    //再遍历子链表
    Scene *child = (Scene*)FirstChild();
    while (child)
    {
        child->OnDraw(image, rangeLimit);
        child = (Scene*)child->Prev();
    }

    return 0;
}
